package cn.mulanbay.admin.api.handler;

import cn.mulanbay.business.handler.CacheHandler;
import cn.mulanbay.persistent.cache.CacheProcessor;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

@Component
public class AdminCacheProcessor implements CacheProcessor {

    @Autowired
    CacheHandler cacheHandler;

    @Override
    public void set(String key, Object value, int expireSeconds) {
        cacheHandler.set(key,value,expireSeconds);
    }

    @Override
    public <T> T get(String key, Class<T> cls) {
        return cacheHandler.get(key,cls);
    }

    @Override
    public boolean delete(String keyPattern) {
        return cacheHandler.delete(keyPattern);
    }
}
